#pragma comment(linker,"/STACK:100000000")
#include "testlib.h"
#include <stdio.h>
#include <string>
using namespace std;
int main()
{
	registerValidation();
	int i, n;
	string s;
	s=inf.readWord(); inf.readEoln();
	ensuref(s.size()>=1 && s.size()<=100, "string size must be in range 1, 100");
	for(i=0; i<s.size(); i++)
		ensuref(s[i]>='a' && s[i]<='z', "letters must be only a-z");
	n=inf.readInt(1, 100, "N"); inf.readEoln();
	for(; n--; )
	{
		s=inf.readWord(); inf.readEoln();
		ensuref(s.size()>=1 && s.size()<=100, "string size must be in range 1, 100");
		for(i=0; i<s.size(); i++)
			ensuref(s[i]>='a' && s[i]<='z', "letters must be only a-z");
	}
	inf.readEof();
	return 0;
}